<?
define('_VIEW_MODEL_','admin');
session_start();
$statu = $_SESSION['statu'];
require_once '../init.php';
if(!$statu){
	echo "<script>window.parent.location.href='./index.php'</script>";
}
$id = intval($id);
$addmoney = 0;
if(isset($act)&&$act=="updatemoney"){
	$value = intval($addmoneynum);
	$addmoney = $value;
	$db->Execute("update {$telper}user set `money` = `money`+'$value' where `id` = '$id'");
}
$userinfo = $db->GetRow("select a.id,a.name,a.sex,a.password,a.headimage,a.phone,a.money,a.birthday,a.zodiac,a.const,a.tickets,a.likebook,a.onlinetime,a.lasttime,a.activetime,a.sign,a.created,a.isphone,a.state,b.title from {$telper}user as a left join {$telper}prop as b on a.medalid=b.id where a.id = '$id'");
if(empty($userinfo)){
	header("Location:./index.php");
}
$bookbbs = $db->GetRow("select bookname from {$telper}bbs_book where useid= $id");
$booname = !empty($bookbbs)?$bookbbs['bookname']:"没有书会";
$colmust = $colmustyle[$userinfo['zodiac']];
$tim = time();
$age = ceil(($tim - $userinfo['birthday'])/(60*60*24*365));
$smartyObj->assign("title",$admintitle);
$smartyObj->assign("userdetiatitle",$userdetiatitle);
$smartyObj->assign("moneyname",$moneyname);
$smartyObj->assign("membertitle",$membertitle);
$smartyObj->assign("userinfo",$userinfo);
$smartyObj->assign("addmoney",$addmoney);
$smartyObj->assign("colmustyle",$colmust);
$smartyObj->assign("bookbbs",$booname);
$smartyObj->assign("age",$age);
$smartyObj->display("userdetial.tpl");
?>